<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<HTML>
  <HEAD>
    <TITLE>Connecting Tools</TITLE>
    <META http-equiv="Content-Type" content="text/html; charset=windows-1252">
    <LINK rel="stylesheet" type="text/css" href="help/shared/DefaultStyle.css">
  </HEAD>

  <BODY lang="EN-US">
    <H1>Tool Connections</H1>

    <P>Ghidra Tools that share data and interact dynamically are said to be <I>connected</I>.&nbsp;
    Tools are connected via <I>tool events</I>.<A name="ToolEvents"></A> Tools generate events when
    you:</P>

    <UL>
      <LI>open or close a&nbsp; Program&nbsp;&nbsp;</LI>

      <LI>move the cursor to a different location in the Program&nbsp;</LI>

      <LI>make a <A href="help/topics/Selection/Selecting.htm">selection</A> in the Program (drag
      the mouse over some addresses).&nbsp;</LI>
    </UL>

    <P>A main reason to connect tools is to have one tool track Program location or selections in
    another tool.</P>

    <P>A tool may generate events that only another tool of this type can process,<A name=
    "SpecialToolEvent"></A> e.g., the Code Browser in one tool produces and consumes an edit event
    that is appropriate for a Code Browser in another tool. Thus, tools can be connected for only
    those events that they have in common.</P>

    <P>Tool connections are directional. You can connect two Tools A and B in a <I>single
    direction</I> such that Tool A generates an event consumed by Tool B; however, Tool A will not
    consume any events generated by Tool B.&nbsp; You can also connect Tools A and B such that the
    connections are <I>bi-directional</I>, where Tool A generates an event consumed by Tool B, and
    Tool B generates an event consumed by Tool A.&nbsp;&nbsp;</P>

    <P>The following sections describe the ways to connect tools.</P>

    <H2><A name="AutomaticToolConnection"></A>Automatic Tool Connection</H2>

    <BLOCKQUOTE>
      <P>You automatically connect tools when you:</P>

      <UL>
        <LI>drag the icon for one running tool onto another running tool, OR&nbsp;</LI>

        <LI>drag the icon from the <A href="Ghidra_Front_end.htm#ToolChest">Tool Chest</A> onto the
        icon for the running tool.&nbsp;&nbsp;</LI>
      </UL>

      <P>The tools are connected in both directions for all events (all Tool A events will be
      consumed by Tool B, and all Tool B events will be consumed by Tool A). For example, if you
      move the cursor in Tool A, the location change is reflected in Tool B. Conversely, if you
      move the cursor in Tool B, the location change is reflected in Tool A.</P>

      <P><IMG border="0" src="help/shared/tip.png"> Drag and drop tool
      icons is the quickest way to connect two tools.</P>
    </BLOCKQUOTE>

    <H2>Manual Tool Connection</H2>

    <BLOCKQUOTE>
      <H3><A name="Connect_Tools"></A>Connecting Tools</H3>

      <BLOCKQUOTE>
        <P>You manually connect tools by selecting the <B><FONT size="4">Tools</FONT></B><IMG
        border="0" src="help/shared/arrow.gif"><B><FONT size="4">Connect
        Tools...</FONT></B> option from the <A href="Ghidra_Front_end.htm">Ghidra Project
        Window</A>.</P>
      </BLOCKQUOTE>
    </BLOCKQUOTE>

    <CENTER>
      <TABLE border="0" width="100%">
        <TR>
          <TD width="100%" align="center"><IMG border="0" src="images/ConnectTools.png"></TD>
        </TR>
      </TABLE>
    </CENTER>

    <BLOCKQUOTE>
      <UL>
        <LI>To connect two tools in one direction for a specific event,</LI>
      </UL>

      <BLOCKQUOTE>
        <OL>
          <LI>Select a tool in the <I>Event Producer</I> list (for example Tool A).</LI>

          <LI>Select a tool in the <I>Event Consumer</I> list (for example Tool B).</LI>

          <LI>Select the check box for the event of interest in the <I>Event Names</I> list.</LI>
        </OL>

        <BLOCKQUOTE>
          <P>Only the consumer tool will respond to the event generated by the producer tool.</P>
        </BLOCKQUOTE>
      </BLOCKQUOTE>

      <UL>
        <LI>To connect two tools in both directions for a specific event,</LI>
      </UL>

      <BLOCKQUOTE>
        <OL>
          <LI>Connect the tools in one direction as described above.</LI>

          <LI>Select Tool B as the event producer and and Tool A as the event consumer.</LI>

          <LI>Select the check box for the event of interest in the <I>Event Names</I> list.</LI>
        </OL>

        <P><IMG border="0" src="help/shared/note.png"> When you select a
        check box for an event, the connection is established immediately. The <B>OK</B> button
        dismisses the dialog, as does selecting the <IMG border="0" src="help/shared/close16.gif"> 
        button. There is no "cancel" associated with connecting
        tools.&nbsp;</P>

        <P><IMG border="0" src="help/shared/tip.png"> The manual connection
        is useful only if you want to control specific events between the tools. From the
        <I>Connect Tools</I> dialog, the easiest way to connect all tools for all events is to
        click on the <B>Connect All</B> button. This action will connect tools in both directions,
        just as though you had dragged and dropped the tool icons to do the <A href=
        "#AutomaticToolConnection">automatic connection</A>.&nbsp; Conversely, disconnect all tools
        for all events by clicking on the <B><FONT size="4">Disconnect All</FONT></B> button.</P>

        <H4><IMG border="0" src="help/shared/note.png"> Some Notes on
        Connecting Tools:</H4>

        <OL>
          <LI>Because of the basic premise of connections, connected Tools should have the same
          program <A href=
          "help/topics/ProgramManagerPlugin/Opening_Program_Files.htm">opened</A>.&nbsp; For
          example, tracking program locations between two tools each showing a different program
          will probably not be very useful.</LI>

          <LI>Tools running in different <A href="Ghidra_Front_end.htm#Workspace">workspaces</A>
          may be connected. Even though tools may not be visible because they are not in your
          active workspace, they can still be connected to tools that are running in other
          workspaces.</LI>
        </OL>

        <P>&nbsp;</P>
      </BLOCKQUOTE>

      <H3>Disconnect Tools</H3>

      <UL>
        <LI>To disconnect tools for a specific event,</LI>
      </UL>

      <BLOCKQUOTE>
        <OL>
          <LI>Select a tool in the <I>Event Producer</I> list (for example Tool A).</LI>

          <LI>Select a tool in the <I>Event Consumer</I> list (for example Tool B).</LI>

          <LI>Turn off the check box for the event of interest.</LI>
        </OL>

        <BLOCKQUOTE>
          <P>The consumer tool will no longer respond to that event.</P>
        </BLOCKQUOTE>
      </BLOCKQUOTE>

      <UL>
        <LI>To disconnect two tools in both directions for a specific event,</LI>
      </UL>

      <BLOCKQUOTE>
        <OL>
          <LI>Disconnect the tools in one direction as described above.</LI>

          <LI>Select Tool B as the event producer and and Tool A as the event consumer.</LI>

          <LI>Turn off the check box for the event of interest in the <I>Event Names</I> list.</LI>
        </OL>
      </BLOCKQUOTE>

      <UL>
        <LI>To disconnect all tools for all events, click on the <B><FONT size="4">Disconnect
        All</FONT></B> button.</LI>
      </UL>

      <BLOCKQUOTE>
        <P><IMG border="0" src="help/shared/note.png">When you deselect a
        check box for an event, the connection is terminated immediately.</P>
      </BLOCKQUOTE>
    </BLOCKQUOTE>

    <P>&nbsp;</P>
  </BODY>
</HTML>
